package com.example.chapter11;

import java.util.concurrent.TimeUnit;

public class Demo03 {

    public static class T extends Thread{
        @Override
        public void run() {
            while (true){
                try {
                    TimeUnit.SECONDS.sleep(20);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                    this.interrupt();
                }
                if (true){
                    break;
                }
            }
        }
    }

    public static void main(String[] args) {
        T t = new T();
        t.start();
        t.interrupt();
    }
}
